package org.tlipoca.smarticle.client;

import org.genntii.smcommon.result.Result;
import org.genntii.smdomain.entity.Channel;
import org.genntii.smdomain.vo.ChannelVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.Map;

@FeignClient("sm-channel")
public interface ChannelClient {

    @GetMapping("/channel/exists/{channelId}")
    Result<Boolean> channelExists(@PathVariable Long channelId);

    @GetMapping("/channel")
    Result<ChannelVO> getChannelById(@RequestParam("channelId") Long channelId, @RequestParam Long userId);

    @GetMapping("/channel/batch")
    Result<Map<Long, ChannelVO>> getChannelListByIds(@RequestParam("channelIds") ArrayList<Long> channelIds, Long userId);
}
